package com.xinghen.core.exception;

import org.springframework.validation.ObjectError;

import java.util.List;

/**
 * @author xinghen
 * @ClassName: ParameterValidException
 * @Package: com.xinghen.core.exception
 * @Description 参数校验错误
 * @create 2017-12-07 17:03
 */
public class ParameterValidException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    /**
     * 描述 : 参数静态校验错误信息
     */
    private final List<ObjectError> allErrors;

    public ParameterValidException(String message, List<ObjectError> allErrors) {
        super(message);
        this.allErrors = allErrors;
    }

    public ParameterValidException(Throwable cause, List<ObjectError> allErrors) {
        super(cause);
        this.allErrors = allErrors;
    }

    public ParameterValidException(String message, Throwable cause, List<ObjectError> allErrors) {
        super(message, cause);
        this.allErrors = allErrors;
    }

    public List<ObjectError> getAllErrors() {
        return allErrors;
    }
}
